package packsack;

import java.util.Arrays;
import java.util.Comparator;

/**
 * @ClassName: leetcode PackSack @Description: packsack @Author: 逸伦 @Date: 2022/5/22 22:43 @Version:
 * 1.0
 */
public class PackSack {

    public static void main(String[] args) {
        // 准备货物
        Item[] items = {new Item(35, 10), new Item(30, 40), new Item(60, 40)};
    }

    // 贪心策略0-1背包 价值最大化

    static void packSackMethod(Item[] items, Comparator<Item> comparator) {
        // 按照要求对货物进行排序
        Arrays.sort(items, comparator);

        int capacity = 150;
        int itemNum = 0;
        int value = 0;
        for (int i = 0; i < items.length; i++) {}
    }

    public static class Item {

        private int weight;

        private int value;

        private double valueDen;

        public Item(int weight, int value) {
            this.weight = weight;
            this.value = value;
            this.valueDen = value / weight;
        }

        public int getWeight() {
            return this.weight;
        }

        public void setWeight(int weight) {
            this.weight = weight;
        }

        public int getValue() {
            return this.value;
        }

        public void setValue(int value) {
            this.value = value;
        }

        public double getValueDen() {
            return this.valueDen;
        }

        public void setValueDen(double valueDen) {
            this.valueDen = valueDen;
        }
    }
}
